.. __How to download The Code: How to download The Code ======================= Drag and drop the .hex file directly onto the MicroBit motherboard. ------------------------------- Connect your micro:bit drive to your computer via USB, click the computer icon, and drag and drop the prepared .hex file directly into the micro:bit drive. Download `code files `_ .. figure:: ./img/查看磁盘.png :align: center :width: 85% .. figure:: ./img/复制hex文件.png :align: center :width: 85% .. figure:: ./img/拖拽进磁盘.png :align: center :width: 85% Download online via MakeCode -------------- What is MakeCode? ^^^^^^^^ MakeCode is a free graphical programming platform developed by Microsoft. It teaches programming basics to children and beginners by dragging and dropping blocks. It is mainly used in conjunction with educational hardware such as micro:bit and Circuit Playground. It supports real-time simulation and JavaScript/Python code conversion and is widely used in maker education in primary and secondary schools. How to use MakeCode ^^^^^^^^ 1. Connect the micro:bit to your computer via USB, click the computer icon, and then click the URL on the micro:bit drive to access the programming interface. .. figure:: ./img/查看磁盘.png :align: center :width: 85% .. figure:: ./img/打开网址.png :align: center :width: 85% 2. Open the MakeCode programming interface for micro:bit: `https://makecode.microbit.org/ `_ .. figure:: ./img/MakeCode首页.png :align: center :width: 85% 3. Click "New Project" to create a new project, and you can start programming the car. .. figure:: ./img/新建项目.png :align: center :width: 85% .. figure:: ./img/项目命名.png :align: center :width: 85% 4. The interface allows you to switch between different programming languages, and the blocks you've already written will be converted into the corresponding programming language. .. figure:: ./img/编程语言切换.png :align: center :width: 85% 5. After writing the code, click the "Download" button to download the .hex file, and then drag and drop it into the micro:bit drive.If device pairing has been performed, online downloading is also possible. .. figure:: ./img/点击下载.png :align: center :width: 85% Import makecode graphical library ^^^^^^^^ If you choose to program the car yourself, the blocks that come with MakeCode may not meet your needs, in which case you will need to import extension libraries. 1. Click the "Expand" option in the module area. 2. In the pop-up window, enter the URL of the extension library to be imported in. To import the LAFVIN Micro:bit Smart Car Kit Library, please enter the following URL: `https://github.com/lafvintech/LAFVIN_MBIT.git `_ 3. Click to expand the library: LAFVIN, and you can use the blocks in this library to program the car. .. figure:: ./img/导入拓展.png :align: center :width: 100% .. figure:: ./img/搜索拓展.png :align: center :width: 100% .. figure:: ./img/添加拓展.png :align: center :width: 100% .. figure:: ./img/导入成功.png :align: center :width: 100% .. figure:: ./img/查看拓展.png :align: center :width: 100% .. figure:: ./img/查看NEO.png :align: center :width: 100% If you find any errors in the imported extensions, you can do the following: .. figure:: ./img/刷新1.png :align: center :width: 100% .. figure:: ./img/刷新2.png :align: center :width: 100% Refresh the page to match the version in the GitHub repository and then reopen your browser. .. tip:: If you use the programming example links or Hex files we provide, the extensions will be added automatically.